import routerC from './router/index_c.js'
import store from './store/c/index.js'
import NProgress from 'nprogress' // Progress 进度条
import 'nprogress/nprogress.css'// Progress 进度条样式
import { Message } from 'element-ui'
import Cookies from 'js-cookie'

routerC.beforeEach((to, from, next) => {
  NProgress.start()
  if ( to.path.startsWith('/coupon')) {
    store.commit('SET_NAV', '/coupon');
  } else if (to.path == '/list') {
    store.commit('SET_NAV', '/');
  } else {
    store.commit('SET_NAV', '');
  }
  // if (!to.meta.unCheckLogin) {
    
  // }
  
  // if (Cookies.get('linses') && Cookies.get('uc')){
  //   store.commit('IS_LOGIN', true)
  // }
  next()
})
store.dispatch('CheckLogin');
routerC.afterEach(() => {
  NProgress.done() // 结束Progress
})
